package Practice;
import java.util.Scanner;
public class TheSumOfNumber {
    public static int theSum(int num){
        if(num==0)return 0;
        return num%10+theSum(num/10);
    }
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int num=scan.nextInt();
        System.out.println(theSum(num));
    }
}
